package task;

import java.util.Scanner;

public class Task3_7 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入一个千以内的整数：");

        int b =(int)(Math.random()*1000);
        for (int i = 0; i < 1000; i++) {
            int a = input.nextInt();
            if( a > b){
                System.out.println("您输入的数字过大请重新输入:");

            }else if(a < b){
                System.out.println("您输入的数字过小请重新输入:");
            }else{
                System.out.println("恭喜你答对啦");
                break;
            }
        }

    }
}
